﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Drawing;
using LevelEditor.Objects;

namespace LevelEditor.Objects.Tiles
{
    class CTile : Tile
    {
        public enum Variables
        {
            PositionX, PositionY, MyTrigger, StandAloneBehavior,
        }
        public CTile(LevelEditor editor)
            : base(editor)
        {
            this.myType = TileType.CommonTile;
        }

        public void PositionXChanged(object sender, EventArgs args)
        {
            if (((TextBox)sender).Text == "") return;


            Point p = Point.Empty;
            try
            {
                p = new Point(int.Parse(((TextBox)sender).Text), this.Location.Y);
            }
            catch (FormatException)
            {
            }
            this.Location = p;

            this.Father.Tile.Location = p;
        }

        public void PositionYChanged(object sender, EventArgs args)
        {
            if (((TextBox)sender).Text == "") return;

            Point p = new Point(this.Location.X, int.Parse(((TextBox)sender).Text));
            this.Location = p;

            this.Father.Tile.Location = p;
        }
    }
}
